﻿
namespace Patterns4Net.ArchitectureExplorer.Diagram
{
    using System.Collections.Generic;
    using Patterns4Net.Core;

    public class Package : DiagramElement
    {
        public Package(string name, IEnumerable<TypeInfo> types)
            : base(name)
        {
            this.Types = types;
            this.Types.ForEach(t => t.Parent = this);
        }

        public IEnumerable<TypeInfo> Types { get; private set; }

        public override void Accept(DiagramVisitor visitor)
        {
            visitor.Visit(this);
            foreach (var type in this.Types)
            {
                type.Accept(visitor);
            }
        }
    }
}
